home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / 3dsdmo / ds3d.frm < prev    next >
Text File  |  1995-05-08  |  10KB  |  309 lines

  1. VERSION 2.00
  2. Begin Form frm3DControlsDemo 
  3.    BackColor       =   &H00C0C0C0&
  4.    BorderStyle     =   1  'Fixed Single
  5.    Caption         =   "3D Controls Demo--VBX vs. Code-Drawn"
  6.    ClientHeight    =   4560
  7.    ClientLeft      =   1350
  8.    ClientTop       =   2085
  9.    ClientWidth     =   6555
  10.    ForeColor       =   &H000000FF&
  11.    Height          =   4965
  12.    Icon            =   DS3D.FRX:0000
  13.    Left            =   1290
  14.    LinkMode        =   1  'Source
  15.    LinkTopic       =   "Form1"
  16.    MaxButton       =   0   'False
  17.    ScaleHeight     =   4560
  18.    ScaleWidth      =   6555
  19.    Top             =   1740
  20.    Width           =   6675
  21.    Begin SSCommand c3dCommandBtn 
  22.       Caption         =   "3D Command Button--&Exit"
  23.       Font3D          =   2  'Raised w/heavy shading
  24.       Height          =   675
  25.       Left            =   195
  26.       TabIndex        =   0
  27.       Top             =   3645
  28.       Width           =   2865
  29.    End
  30.    Begin SSPanel Panel3D2 
  31.       AutoSize        =   3  'AutoSize Child To Panel
  32.       BackColor       =   &H00C0C0C0&
  33.       BevelInner      =   2  'Raised
  34.       BevelOuter      =   0  'None
  35.       BevelWidth      =   2
  36.       BorderWidth     =   0
  37.       Caption         =   "Panel3D2"
  38.       Font3D          =   0  'None
  39.       ForeColor       =   &H00800000&
  40.       Height          =   675
  41.       Left            =   195
  42.       TabIndex        =   4
  43.       Top             =   2745
  44.       Width           =   2865
  45.       Begin PictureBox picScrollCorner 
  46.          AutoSize        =   -1  'True
  47.          Height          =   240
  48.          Index           =   1
  49.          Left            =   2580
  50.          Picture         =   DS3D.FRX:0302
  51.          ScaleHeight     =   210
  52.          ScaleWidth      =   210
  53.          TabIndex        =   14
  54.          TabStop         =   0   'False
  55.          Top             =   405
  56.          Width           =   240
  57.       End
  58.       Begin TextBox txtTextBoxIn3D 
  59.          BorderStyle     =   0  'None
  60.          Height          =   615
  61.          Left            =   45
  62.          MultiLine       =   -1  'True
  63.          ScrollBars      =   3  'Both
  64.          TabIndex        =   13
  65.          TabStop         =   0   'False
  66.          Text            =   "Standard text box inside THREED.VBX frame"
  67.          Top             =   30
  68.          Width           =   2775
  69.       End
  70.    End
  71.    Begin OptionButton optStandardOption 
  72.       BackColor       =   &H00C0C0C0&
  73.       Caption         =   "Standard Option"
  74.       Height          =   315
  75.       Left            =   3510
  76.       TabIndex        =   12
  77.       TabStop         =   0   'False
  78.       Top             =   2265
  79.       Value           =   -1  'True
  80.       Width           =   2865
  81.    End
  82.    Begin SSOption o3dOption 
  83.       Caption         =   "3D Option"
  84.       Font3D          =   4  'Inset w/heavy shading
  85.       ForeColor       =   &H00000000&
  86.       Height          =   285
  87.       Left            =   195
  88.       TabIndex        =   11
  89.       Top             =   2265
  90.       Value           =   -1  'True
  91.       Width           =   1410
  92.    End
  93.    Begin Frame fraStandardFrame 
  94.       BackColor       =   &H00C0C0C0&
  95.       Caption         =   "Standard Frame"
  96.       Height          =   945
  97.       Left            =   3510
  98.       TabIndex        =   6
  99.       Top             =   1155
  100.       Width           =   2865
  101.    End
  102.    Begin SSFrame f3dFrame 
  103.       Caption         =   "3D Frame"
  104.       Font3D          =   1  'Raised w/light shading
  105.       ForeColor       =   &H00000000&
  106.       Height          =   945
  107.       Left            =   180
  108.       TabIndex        =   3
  109.       Top             =   1155
  110.       Width           =   2865
  111.    End
  112.    Begin CheckBox chkStandardCheckBox 
  113.       BackColor       =   &H00C0C0C0&
  114.       Caption         =   "Standard Check Box"
  115.       Height          =   270
  116.       Left            =   3510
  117.       TabIndex        =   10
  118.       TabStop         =   0   'False
  119.       Top             =   675
  120.       Value           =   1  'Checked
  121.       Width           =   2865
  122.    End
  123.    Begin SSCheck x3dCheckBox 
  124.       Caption         =   "3D Check Box"
  125.       Font3D          =   1  'Raised w/light shading
  126.       Height          =   270
  127.       Left            =   210
  128.       TabIndex        =   9
  129.       TabStop         =   0   'False
  130.       Top             =   675
  131.       Value           =   -1  'True
  132.       Width           =   1530
  133.    End
  134.    Begin SSPanel p3dPanel 
  135.       BackColor       =   &H00C0C0C0&
  136.       BevelWidth      =   2
  137.       BorderWidth     =   0
  138.       Caption         =   "3D Panel"
  139.       Font3D          =   3  'Inset w/light shading
  140.       ForeColor       =   &H00800000&
  141.       Height          =   315
  142.       Left            =   180
  143.       TabIndex        =   2
  144.       Top             =   150
  145.       Width           =   2865
  146.    End
  147.    Begin PictureBox picScrollCorner 
  148.       AutoSize        =   -1  'True
  149.       Height          =   240
  150.       Index           =   0
  151.       Left            =   6135
  152.       Picture         =   DS3D.FRX:046C
  153.       ScaleHeight     =   210
  154.       ScaleWidth      =   210
  155.       TabIndex        =   8
  156.       TabStop         =   0   'False
  157.       Top             =   3180
  158.       Width           =   240
  159.    End
  160.    Begin TextBox txtTextBox 
  161.       Height          =   675
  162.       Left            =   3510
  163.       MultiLine       =   -1  'True
  164.       ScrollBars      =   3  'Both
  165.       TabIndex        =   7
  166.       Text            =   "3D controls!"
  167.       Top             =   2745
  168.       Width           =   2865
  169.    End
  170.    Begin CommandButton cmdExit 
  171.       BackColor       =   &H00000000&
  172.       Caption         =   "Standard Command Button--E&xit"
  173.       Height          =   675
  174.       Left            =   3510
  175.       TabIndex        =   1
  176.       Top             =   3645
  177.       Width           =   2865
  178.    End
  179.    Begin Label lblStandardLabel 
  180.       Alignment       =   2  'Center
  181.       BackColor       =   &H00C0C0C0&
  182.       Caption         =   "Standard Label"
  183.       Height          =   270
  184.       Left            =   3495
  185.       TabIndex        =   5
  186.       Top             =   180
  187.       Width           =   2865
  188.    End
  189. End
  190. '3D Controls By Code--demonstration and template code.
  191.    Option Explicit
  192.    DefInt A-Z
  193.    
  194.    'Constants to describe control 3D state to paint.
  195.    Const RAISED = -1    'Frame is raised
  196.    Const RECESSED = 0   'Frame is recessed
  197.  
  198.    'Color values to use for specific lines that give 3D look.
  199.    'For the line, Red, Green and Blue values will all
  200.    'be set to this value, so all three will be equal--which
  201.    'produces a shade of grey.
  202.    Const WHITE = 255       'Light gray/white
  203.    Const DARKGRAY = 128    'Dark gray
  204.    Const BLACK = 64        'Black
  205.    
  206.    'Variable to hold the width of the frame desired.
  207.    Dim FrameWidth%         'Width of 3d frame (in pixels)
  208.    
  209.    'A flag.
  210.    Dim flgScrollCornerClicked%
  211.    
  212.  
  213. Sub c3dCommandBtn_Click ()
  214.    Unload Me
  215.    End
  216. End Sub
  217.  
  218. Sub cmdExit_Click ()
  219.   Unload Me
  220.   End
  221. End Sub
  222.  
  223. Sub Form_Load ()
  224.    Left = (Screen.Width - Width) / 2: Top = (Screen.Height - Height) / 2
  225. End Sub
  226.  
  227. Sub Form_Paint ()
  228.    'The calling syntax for the called sub is:
  229.    'subInit3D (Ctrl As Control, ThreeDState As Integer)
  230.    'So we pass it two parameters within the parens: the
  231.    'control we want to run the sub on, and the CONSTANT
  232.    'name for the 3D state we want for that control.
  233.    'EACH CONTROL FOR WHICH A 3D EFFECT IS DESIRED
  234.    'MUST BE INITIALIZED SEPARATELY!
  235.    If flgScrollCornerClicked = True Then
  236.       Call subInit3D(lblStandardLabel, RECESSED)
  237.       Call subInit3D(chkStandardCheckBox, RECESSED)
  238.       Call subInit3D(fraStandardFrame, RECESSED)
  239.       Call subInit3D(optStandardOption, RECESSED)
  240.       Call subInit3D(txtTextBox, RECESSED)
  241.       Call subInit3D(cmdExit, RECESSED)
  242.     Else
  243.       Call subInit3D(lblStandardLabel, RAISED)
  244.       Call subInit3D(chkStandardCheckBox, RAISED)
  245.       Call subInit3D(fraStandardFrame, RAISED)
  246.       Call subInit3D(optStandardOption, RAISED)
  247.       Call subInit3D(txtTextBox, RAISED)
  248.       Call subInit3D(cmdExit, RAISED)
  249.    End If
  250. End Sub
  251.  
  252. Sub picScrollCo